---
id: 657f47b12c51e41b3149e584
title: 20° passo
challengeType: 20
dashedName: step-20
---

# --description--

You will still need to join the list elements into a string, strip off any dangling underscores and return the string. Even though you can do that like you did earlier, let's see a shorter alternative.

```py
return ''.join(snake_cased_char_list).strip('_')
```

This single line of code will join the list of characters into a string, strip off any dangling underscores, and return the resulting string. Add this line on the same level as the `snake_cased_char_list` variable and inside the `convert_to_snake_case()` function.

# --hints--

You should return `''.join(snake_cased_char_list).strip('_')` at the end of `convert_to_snake_case()` function.

```js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        const convert_to_snake_case = __helpers.python.getDef("\n" + transformedCode, "convert_to_snake_case");
        const { function_body } = convert_to_snake_case;

        assert.match(function_body, / +return\s+('|")\1\.join\(\s*snake_cased_char_list\s*\)\.strip\(\s*("|')_\2\s*\)/);
    }
})
```

# --seed--

## --seed-contents--

```py
def convert_to_snake_case(pascal_or_camel_cased_string):
    # snake_cased_char_list = []
    # for char in pascal_or_camel_cased_string:
    #     if char.isupper():
    #       converted_character = '_' + char.lower()
    #       snake_cased_char_list.append(converted_character)
    #     else:
    #         snake_cased_char_list.append(char)
    # snake_cased_string = ''.join(snake_cased_char_list)
    # clean_snake_cased_string = snake_cased_string.strip('_')

    # return clean_snake_cased_string

--fcc-editable-region--
    snake_cased_char_list = [
        '_' + char.lower() if char.isupper()
        else char
        for char in pascal_or_camel_cased_string
    ]

--fcc-editable-region--



def main():
    print(convert_to_snake_case('aLongAndComplexString'))

if __name__ == '__main__':
    main()
```
